{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c73d803c-a005-496f-9812-7eb414ce6449",
   "metadata": {},
   "source": [
    "# Filled Contour Plot\n",
    "\n",
    "A filled contour plot of a synthetic dataset."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ac5ea091-6484-4fc8-9852-d48acd90cc74",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hvplot.xarray  # noqa\n",
    "import numpy as np\n",
    "import xarray as xr\n",
    "\n",
    "x = y = np.linspace(-10, 10, 200)\n",
    "X, Y = np.meshgrid(x, y)\n",
    "Z = 10 * np.exp(-(X**2 + Y**2) / 20)\n",
    "ds = xr.DataArray(Z, coords=[(\"y\", y), (\"x\", x)], name=\"z\").to_dataset()\n",
    "\n",
    "ds.hvplot.contourf(\n",
    "    x=\"x\",\n",
    "    y=\"y\",\n",
    "    z=\"z\",\n",
    "    levels=10,\n",
    "    cmap=\"viridis\",\n",
    "    data_aspect=1,\n",
    "    title=\"Filled Contour Plot (Bokeh)\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f24650ff-507f-4c55-b8b9-8962ae84969f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hvplot.xarray  # noqa\n",
    "import numpy as np\n",
    "import xarray as xr\n",
    "hvplot.extension('matplotlib')\n",
    "\n",
    "x = y = np.linspace(-10, 10, 200)\n",
    "X, Y = np.meshgrid(x, y)\n",
    "Z = 10 * np.exp(-(X**2 + Y**2) / 20)\n",
    "ds = xr.DataArray(Z, coords=[(\"y\", y), (\"x\", x)], name=\"z\").to_dataset()\n",
    "\n",
    "ds.hvplot.contourf(\n",
    "    x=\"x\",\n",
    "    y=\"y\",\n",
    "    z=\"z\",\n",
    "    levels=10,\n",
    "    cmap=\"viridis\",\n",
    "    data_aspect=1,\n",
    "    title=\"Filled Contour Plot (Matplotlib)\",\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4f0cd955-3e03-42a5-b581-f828036e1716",
   "metadata": {},
   "source": [
    ":::{seealso}\n",
    "- [Filled Contour Plots reference documentation](../../ref/api/manual/hvplot.hvPlot.contourf.ipynb).\n",
    ":::"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
